import { AdvancedButtonProps } from "../AdvancedButton/AdvancedButton";
import { SelectActionMenu } from "./SelectActionMenu"

interface PrioritySelectActionMenuProps {
  children: React.ReactNode,
  getValue(value: number): void,
  value: number
}

export const PrioritySelectActionMenu = ({ children, getValue, value }: PrioritySelectActionMenuProps) => {
  const actionItems: AdvancedButtonProps = {
    variant: 'accent',
    className: 'w-full justify-start py-2 pr-3 h-auto ',
    icon: 'Fire',
  };

  type AdvancedButtonPriorityProps = AdvancedButtonProps & {
    customvalue: 0 | 1 | 2 | 3
  }

  const taskCardOptions: AdvancedButtonPriorityProps[] = [
    {
      iconColor: '#F44336',
      children: 'Срочно',
      customvalue: 1,
      ...actionItems
    },
    {
      iconColor: '#FFB800',
      children: 'Высокий',
      customvalue: 2,
      ...actionItems
    },
    {
      iconColor: '#3D6BED',
      children: 'Низкий',
      customvalue: 3,
      ...actionItems
    }
  ];

  return <SelectActionMenu
    actions={taskCardOptions}
    resetValue={0}
    defaultValue={value}
    getValue={getValue}
  >
    {children}
  </SelectActionMenu>
}